<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>修改绑定手机</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="format-detection" content="telephone=no" />
	<link rel="stylesheet" href="../../css/public-heder-Reset.css">
	<link rel="stylesheet" href="../../css/input-button.css">
</head>
<body>
	<!-- page_box -->
	<div class="page-box">
		<!-- header -->
		<header class="page-header">
			<a href="Uaccount.html" class="back"></a>
			<p class="pege-name">修改绑定手机</p>
		</header>
		<div class="liubai"></div>
		<!-- header /-->
		<!-- User-information -->
		<div class="User-information">
			<div class="User-form">
				<div class="phone-number">
					<label>
						<input type="tel" class="reewrw" style="font-size:17px" placeholder="请输入您的手机号" maxlength="11">
						<span class="phone"></span>
					</label>
				</div>
				<div class="Verification-code">
					<label>
						<input type="text" class="yanzm eliminate" style="font-size:17px" maxlength="8" placeholder="请输入验证码">
						<span class=""></span>
						<em class="phone-code">获取验证码</em>
					</label>
				</div> 
			</div>	
			<div class="submit-btn">
				<button style="border:none" disabled="disabled">确定</button>
			</div>
		</div>
		<!-- User-information / -->
	</div>
<script type="text/javascript" src="../../js/jquery.min.js"></script>
<script type="text/javascript" src="../../js/http-url.js"></script>
<script type="text/javascript">
	if (top.location != location)  
	{  
		top.location.href = location.href;  
	} 
	$(function($){
		$('.phone-code').click(function() {
			if(isClick){
				return ;
			}
			isClick=true;
			// 获取变量
			var phone_number=$('.phone-number input').val().trim();
			var UserData={'phone_number':phone_number}
			// 判断号码是否符合规则
			if (!reg.test(phone_number)) {
				promptBox('请输入正确的手机号码！');
				isClick=null;
				return
			}else {
				ajaxRequest('/api/user/ca/edit/phone',UserData,function(data){
				$('.phone-code').css({"color":"#ccc","borderColor":"#ccc"});
				//调用定时函数 设定剩余时间  名字 提示字符串 原本字符串 改变颜色
				timer(60,".phone-code","秒后失效","获取验证码","#6eba6f")
				},false)
			}; 
		});	
		$("input").on("keyup", function (event) {
			var phone_number=$('.phone-number input').val().trim();
			var Veri_code=$('.Verification-code input').val().trim();
			//输入信息符合规则 开启提交按钮
		   if(reg.test(phone_number) && Veri_code.length>=6){
			    sureSubmit()
		   }else {
	   			cannotSubmit()
		   }
		 });
			//提交注册
		$('.submit-btn').find('button').click(function(){
			submitOk()
			isClick=null;
			var phone_number=$('.phone-number input').val().trim();
			var Veri_code=$('.Verification-code input').val().trim();
			var UserData={'phone_number':phone_number,'Veri_code':Veri_code}
	   		ajaxRequest('/api/user/ca/edit/phone',UserData,
	   			function(data){
	   				
	   			},false)
	   		});
		// $(".paswd input").on("focus", function (event) {
		//   	$('.paswd input').val('1111');
		//  });
	});
</script>
</body>
</html>